﻿@model FantasyBlog.Models.UserWithRolesModel
@{
    ViewBag.Title = "EditRole";
    Layout = "~/Views/Shared/_CPLayout.cshtml";
}
<h2>
    Role</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<form name="form" id="form" action="/User/EditRole" method="post">
<input type="hidden" name="username" value="@Model.UserInfo.ID.ToString()"/>
@foreach (var item in Model.AllRoles)
{
    <p>
        <input type="checkbox" name="@item.name.ToString().Trim()" value="@Model.MyRoles[item].ToString()" 
        @if (Model.MyRoles[item])
        {
            @:checked
            }
        />
        <b>@item.name</b>
    </p>
}
<p class="submit">
    <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Save"
        tabindex="100" />
</p>
</form>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
